package com.scsj.supermarket.adapter;

import android.content.Context;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.scsj.supermarket.R;
import com.scsj.supermarket.bean.BalanceBean;
import com.scsj.supermarket.bean.GetTradeRecordListBean;
import com.scsj.supermarket.bean.SelectTackCashByPageInfoBean;
import com.scsj.supermarket.utils.SkipUtils;

import java.util.List;

/**
 * 余额
 */

public class WithDrawalAdapter extends BaseQuickAdapter<SelectTackCashByPageInfoBean.DataBean.ListBean, BaseViewHolder> {

    public WithDrawalAdapter(Context context,List data) {
        super(R.layout.item_balance_detail, data);
        this.mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, final SelectTackCashByPageInfoBean.DataBean.ListBean item) {
        //提现状态 1.申请提现;2.拒绝提现; 3.同意提现
        switch (item.getCashState()) {
            case 1:
                helper.setText(R.id.title_tv, "提现中");
                break;
            case 2:
                helper.setText(R.id.title_tv, "提现失败");
                break;
            case 3:
                helper.setText(R.id.title_tv, "提现成功");
                break;
            default:

                break;
        }

        helper.setText(R.id.time_tv, item.getCashTakeDate());

//        helper.setText(R.id.name_tv,item.getMoney()+"");
        helper.setText(R.id.money_tv, item.getCashAmount()+"");
        helper.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SkipUtils.toWithDraw(mContext,item.getTackCasdId());
            }
        });
    }
}
